import Vue from "vue";
import VueRouter from "vue-router";

import Home from "@/views/Home.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/",
      name: "home",
      component: Home,
      children: [
        {
          path: "films",
          name: "films",
          component: () => import("@/views/HomeFilms.vue"),
        },
        {
          path: "cinemas",
          name: "cinemas",
          component: () => import("@/views/HomeCinemas.vue"),
        },
        {
          path: "me",
          name: "me",
          component: () => import("@/views/HomeMe.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    {
      path: "/register",
      name: "register",
      component: () => import("@/views/Register.vue"),
    },
  ],
});

export default router;
